<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script src="http://api.map.baidu.com/api?v=2.0&ak=你的ID"></script>
<script>
    //获取本地经纬度
    var refulshLocation=function(callBack){
        var _locatJW = window.sessionStorage.getItem("locatJW");
        if(_locatJW&&callBack){
            callBack(_locatJW);
            return;
        }
        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function(r){
            if(this.getStatus() == BMAP_STATUS_SUCCESS){
                //var mk = new BMap.Marker(r.point);
                var longitude = r.point.lng;
                var latitude = r.point.lat;
                window.sessionStorage.setItem("locatJW",longitude+","+latitude);
                //alert(longitude+","+latitude);
            }
        });
    }
    refulshLocation();
</script>
</body>
</html>